<!doctype html>
<!--
Copyright 2013 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<html>
  <head>
    <title>paper-icon-button</title>
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
    <script src="../webcomponentsjs/webcomponents.js"></script>

    <link rel="import" href="../core-icons/core-icons.html">
    <link rel="import" href="paper-icon-button.html">

    <style shim-shadowdom>
      body {
        font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
        font-size: 14px;
        margin: 0;
        padding: 24px;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        -webkit-touch-callout: none;
      }

      section {
        padding: 20px 0;
      }

      section > div {
        padding: 14px;
        font-size: 16px;
      }

      paper-icon-button {
        vertical-align: middle;
      }

      paper-icon-button.hover:hover {
        background: #eee;
        border-radius: 50%;
      }

      paper-icon-button.red {
        color: #fe774d;
      }

      paper-icon-button.blueRipple::shadow #ripple {
        color: #4285f4;
      }

      paper-icon-button.huge::shadow #icon {
        width: 100px;
        height: 100px;
      }

/*      core-selector paper-icon-button:not([active])::shadow core-icon {
        color: #c9c9c9;
      }
*/
      paper-icon-button.custom {
        color: #a9edff;
      }
    </style>

  </head>

  <body unresolved onclick="clickAction(event);">

    <column>

      <section>

        <div>Icon buttons</div>

        <paper-icon-button icon="menu" title="menu"></paper-icon-button>
        <paper-icon-button icon="arrow-back" title="arrow-back"></paper-icon-button>
        <paper-icon-button icon="arrow-forward" title="arrow-forward"></paper-icon-button>
        <paper-icon-button disabled icon="clear" title="clear"></paper-icon-button>

      </section>

      <br>

      <section>

        <div>Styled</div>

        <paper-icon-button class="hover" icon="favorite" title="with :hover style"></paper-icon-button>
        <paper-icon-button class="red" icon="favorite" title="red icon"></paper-icon-button>
        <paper-icon-button class="red blueRipple" icon="favorite" title="red icon, blue ripple"></paper-icon-button>

        <br>

        <paper-icon-button class="huge" icon="favorite" title="huge"></paper-icon-button>

      </section>

      <section>

        <div>Link</div>

        <a href="https://www.polymer-project.org" target="_blank">
          <paper-icon-button icon="polymer" title="polymer"></paper-icon-button>
        </a>

      </section>

<!--       <section>
        <span>focused</span>
        <paper-icon-button focused icon="social:cake"></paper-icon-button>
        <paper-icon-button focused icon="social:plus-one"></paper-icon-button>
      </section>
 -->
<!--       <section>
        <span>segmented</span>
        <core-selector selected="1">
          <paper-icon-button fill isToggle icon="maps:directionswalk"></paper-icon-button>
          <paper-icon-button fill isToggle icon="maps:directions-bike"></paper-icon-button>
          <paper-icon-button fill isToggle icon="maps:directions-transit"></paper-icon-button>
          <paper-icon-button fill isToggle icon="maps:directions-car"></paper-icon-button>
        </core-selector>
      </section>
 -->
      <section>

        <div>Custom icon src</div>

        <paper-icon-button class="custom" src="https://assets-cdn.github.com/images/modules/logos_page/Octocat.png" aria-label="octocat" title="octocat"></paper-icon-button>

      </section>
    </column>

    <script>

      function clickAction(e) {
        var t = e.target;
        if (t.localName === 'paper-icon-button') {
          if (t.hasAttribute('disabled')) {
            console.error('should not be able to click disabled button', t);
          } else {
            console.log('click', t);
          }
        }
      }

    </script>

  </body>
</html>
